﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DispatchAssist.BusinessLogical.Model
{
    /// <summary>
    /// FlightInfo
    /// </summary>
    public class FlightInfo
    {

        /// <summary>
        /// FlightInfo 构造函数
        /// </summary>
        public FlightInfo()
        { }


        /// <summary>
        /// FlightInfo OR映射构造函数
        /// </summary>
        public FlightInfo(System.Data.IDataReader dr)
        {
            this.FlightInfoID = Convert.ToString(dr["FlightInfoID"]);
            this.Carrier = Convert.ToString(dr["Carrier"]);
            this.FlightNo = Convert.ToString(dr["FlightNo"]);
            this.TailNo = Convert.ToString(dr["TailNo"]);
            this.DeptAirport = Convert.ToString(dr["DeptAirport"]);
            this.ArrAirport = Convert.ToString(dr["ArrAirport"]);
            this.PlanDeptTime = Convert.ToDateTime(dr["PlanDeptTime"]);
            this.PlanArrTime = Convert.ToDateTime(dr["PlanArrTime"]);
            this.EstDeptTime = Convert.ToDateTime(dr["EstDeptTime"]);
            this.EstArrTime = Convert.ToDateTime(dr["EstArrTime"]);
            this.RealDeptTime = Convert.ToDateTime(dr["RealDeptTime"]);
            this.RealArrTime = Convert.ToDateTime(dr["RealArrTime"]);
            this.DeptBackup = Convert.ToString(dr["DeptBackup"]);
            this.ArrBackup = Convert.ToString(dr["ArrBackup"]);
            this.RouteBackup = Convert.ToString(dr["RouteBackup"]);
            this.LastModifyTime = Convert.ToDateTime(dr["LastModifyTime"]);
            this.DeleteFlag = Convert.ToBoolean(dr["DeleteFlag"]);
        }


        /// <summary>
        /// 
        /// </summary>
        public string FlightInfoID { get; set; }

        /// <summary>
        /// 承运人
        /// </summary>
        public string Carrier { get; set; }

        /// <summary>
        /// 航班号
        /// </summary>
        public string FlightNo { get; set; }

        /// <summary>
        /// 飞机尾号
        /// </summary>
        public string TailNo { get; set; }

        /// <summary>
        /// 起始站
        /// </summary>
        public string DeptAirport { get; set; }

        /// <summary>
        /// 到达站
        /// </summary>
        public string ArrAirport { get; set; }

        /// <summary>
        /// 计划起飞时间
        /// </summary>
        public DateTime PlanDeptTime { get; set; }

        /// <summary>
        /// 计划到达时间
        /// </summary>
        public DateTime PlanArrTime { get; set; }

        /// <summary>
        /// 预计起飞时间
        /// </summary>
        public DateTime? EstDeptTime { get; set; }

        /// <summary>
        /// 预计到达时间
        /// </summary>
        public DateTime? EstArrTime { get; set; }

        /// <summary>
        /// 实际起飞时间
        /// </summary>
        public DateTime? RealDeptTime { get; set; }

        /// <summary>
        /// 实际到达时间
        /// </summary>
        public DateTime? RealArrTime { get; set; }

        /// <summary>
        /// 起飞备降场
        /// </summary>
        public string DeptBackup { get; set; }

        /// <summary>
        /// 到达备降场
        /// </summary>
        public string ArrBackup { get; set; }

        /// <summary>
        /// 航路备降场（集合）
        /// </summary>
        public string RouteBackup { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime LastModifyTime { get; set; }

        /// <summary>
        /// 逻辑删除标记
        /// </summary>
        public bool DeleteFlag { get; set; }

        /// <summary>
        /// 相关类型
        /// </summary>
        public int RelationType
        {
            get;
            set;
        }

        public string GroupCode { get; set; }
        public override string ToString()
        {
            return string.Format("[承运人：{0},航班号：{1},飞机尾号：{2},起始站：{3},到达站：{4}]", Carrier, FlightNo, TailNo, DeptAirport, ArrAirport);
        }

    }
}
